package com.chaoyong.higo.activity;

import com.chaoyong.higo.R;
import com.chaoyong.higo.base.BaseActivity;
import com.chaoyong.higo.utils.MyCountTimer;
import com.chaoyong.higo.utils.V;

import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * 修改邮箱
 * 
 * @author zk
 *
 */
public class NotifyEmailActivity extends BaseActivity {

	private LinearLayout base_left_iv;// 左侧返回按钮
	private TextView base_title_tv;// 标题
	private TextView base_right_tv;// 标题右侧文字

	/** 当前手机号 */
	private TextView notify_tel_num;
	/** 输入验证码 */
	private EditText notify_code_input;
	/** 获取验证码 */
	private TextView notify_get_code;
	/** 确定 */
	private Button notify_btn;
	
	private MyCountTimer timer;

	@Override
	public int layoutResID() {
		return R.layout.activity_notify_telnumber;
	}

	@Override
	public void findView() {
		findTitleIds();

		notify_tel_num = V.f(this, R.id.notify_tel_num);
		notify_code_input = V.f(this, R.id.notify_code_input);
		notify_get_code = V.f(this, R.id.notify_get_code);
		notify_btn = V.f(this, R.id.notify_btn);
	}

	private void findTitleIds() {
		base_left_iv = V.f(this, R.id.base_left_iv);
		base_title_tv = V.f(this, R.id.base_title_tv);
		base_right_tv = V.f(this, R.id.base_right_tv);

		base_title_tv.setText("修改邮箱");
		base_right_tv.setVisibility(View.GONE);
	}

	@Override
	public void init() {
		base_left_iv.setOnClickListener(this);
		notify_get_code.setOnClickListener(this);
		notify_btn.setOnClickListener(this);
		
		timer = new MyCountTimer(notify_get_code, 0xfff30008, 0xff969696);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.base_left_iv:// title左侧返回
			this.finish();
			break;
		case R.id.notify_get_code:// 获取验证码
//			showToast("获取验证码");
			timer.start();
			break;
		case R.id.notify_btn:// 确定
			showToast("确定");
			break;
		}
	}

}
